package day1027.CarRentalCompany;
//轿车  子类
public class  Carriage extends Car{
    public Carriage(String type, String brand, String carnumber, int seatnum, double rent, boolean state) {
        super(type, brand, carnumber, seatnum, rent, state);

    }

    public  double calculate(int day){
        double price;
        if (day>7){
            price = day*getRent()*0.9;
            return price;
        }
        if (day>30){
            price = day*getRent()*0.8;
            return price;
        }
        if (day>150){
            price = day*getRent()*0.7;
            return price;
        }
        price = day*getRent();
        return price;
    }
}
